Micron Document




Ren (command)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
ren (or rename) is a shell command for renaming a file and in some implementations (such as AmigaDOScite-ref-1[1]) a directory.

Some shells with ren also provide a move command that provides for moving between directories. On systems that do not support a move command (such as MS-DOS older than 6.00), the user could copy a file to a new destination and then delete the original file. In DOSBox, ren can move files.

The command is in various shells such as COMMAND.COM, Command Prompt,cite-ref-2[2] 4DOS, 4NT and PowerShell. In MS-DOS, the command is available in versions 1 and later.cite-ref-runningmsdos-3-0[3] In PowerShell, ren is a predefined alias for the Rename-Item Cmdlet which serves the same essential purpose.cite-ref-4[4]

Similar commands are available in many operating systems. The command is available in the CP/M,cite-ref-5[5] MP/M,cite-ref-mpm1-6-0[6]cite-ref-mp-m-1981-ug-7-0[7] Cromemco DOS,cite-ref-8[8] TRIPOS,cite-ref-9[9] OS/2,cite-ref-10[10] ReactOS,cite-ref-11[11] SymbOS, and DexOS. Multics includes a rename command to rename a directory entry; which could be contracted to rn.cite-ref-12[12] A rename command which in some cases can be contracted to ren is provided in Stratus VOS,cite-ref-13[13] RT-11,cite-ref-14[14] OS/8,cite-ref-os8-handb-15-0[15] RSX-11,cite-ref-16[16] ISIS-II,cite-ref-17[17] iRMX 86,cite-ref-18[18] TOPS-20,cite-ref-cmdref-19-0[19] Z80-RIO,cite-ref-20[20] FLEX,cite-ref-21[21] OS-9,cite-ref-22[22] FlexOS,cite-ref-23[23] 4690 OS,cite-ref-24[24] MPE/iX,cite-ref-25[25] THEOS/OASIS,cite-ref-26[26] and OpenVMScite-ref-27[27] A rename command is supported by 86-DOS.cite-ref-28[28] DR DOS 6.0 includes ren and rename commands.cite-ref-drdos6userguide-29-0[29] PC-MOS includes an implementation of rename.cite-ref-30[30]cite-ref-31[31] It is also available in the MS-DOS emulator DOSBox.

Contents


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Example

The following renames file foo to bar.

> ren foo bar

The following renames a file specified by a fully qualified path. The first parameter may contain drive and path information, but the second parameter must be only a file name.

> rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" Wildlife2.wmv

The following removes abcd of a file name in Command Prompt based on the following rules:

• Same number of / as the number of characters to remove
• Requries double quotes for both arguments
• Won't remove . from a file name

> rename "abcd*.txt" "////*.txt"

See also

Wikibooks has a book on the topic of:

Guide to Windows Commands


References

cite-note-11. citerefr-gheimerspanik1988Rügheimer, Hannes; Spanik, Christian (September 19, 1988). AmigaDOS quick reference. Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive.
cite-note-22. "Microsoft TechNet Rename (ren) article". 11 September 2009.
cite-note-runningmsdos-33. citerefwolverton2003Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
cite-note-44. "Microsoft TechNet PowerShell Rename-Item (ren) article". 22 October 2009.
cite-note-55. "Manual" (PDF). www.cpm.z80.de. Retrieved 2020-09-19.
cite-note-mpm1-66. citerefdigital-research1981Digital Research (July 1981) [1979]. MP/M - Multi-Programming Monitor Control Program - User's Guide (PDF) (4 ed.). Pacific Grove, CA, USA: Digital Research. Archived (PDF) from the original on 2017-01-04. Retrieved 2017-01-04.
cite-note-mp-m-1981-ug-77. citerefdigital-research1981Digital Research (1981-09-25). MP/M-86 Operating System - User's Guide (PDF) (1 ed.). Pacific Grove, CA, USA: Digital Research. Archived (PDF) from the original on 2017-01-04. Retrieved 2017-01-04.
cite-note-88. CDOS USER'S MANUAL
cite-note-99. "Manual" (PDF). www.pagetable.com. Retrieved 2020-09-19.
cite-note-1010. "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-06.
cite-note-1111. "reactos/reactos". GitHub. 3 January 2022.
cite-note-1212. "Multics Commands". www.multicians.org.
cite-note-1313. "Manual" (PDF). stratadoc.stratus.com. Retrieved 2020-09-19.
cite-note-1414. "RT-11 HELP FILE". paleoferrosaurus.com. Archived from the original on 2018-07-17. Retrieved 2018-07-16.
cite-note-os8-handb-1515. "Concise Command Language" (CCL)."OS/8 Handbook" (PDF). April 1974. Retrieved 28 November 2017.
cite-note-1616. citerefjohn-f-pieper1987John F. Pieper (1987). RSX A Guide for Users (PDF). Digital Equipment Corporation. ISBN 0-932376-90-8. Retrieved 2020-09-19.
cite-note-1717. ISIS II Users Guide
cite-note-1818. iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6
cite-note-cmdref-1919. "TOPS-20 Command manual" (PDF). Archived from the original (PDF) on 2020-08-09. Retrieved 2018-07-18.
cite-note-2020. Z80-RIO OPERATING SYSTEM USER'S MANUAL
cite-note-2121. "FLEX 2.0 User's Manual" (PDF).
cite-note-2222. citerefpaul-s-dayan1992Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
cite-note-2323. "FlexOS User's Guide" (PDF). www.bitsavers.org. 1986. Archived from the original (PDF) on 2010-08-08. Retrieved 2020-09-19.
cite-note-2424. "Users guide" (PDF). archive.org. Retrieved 2020-09-19.
cite-note-2525. "MPE/iX Command Reference Manual" (PDF). Archived from the original (PDF) on 2018-10-21. Retrieved 2018-10-21.
cite-note-2626. THEOS/OASIS User's Handbook
cite-note-2727. OpenVMS User's Manual
cite-note-2828. 86-DOS - Disk Operating System for the 8086 - User's Manual (PDF). Version 0.3 (Preliminary ed.). Seattle, Washington, USA: Seattle Computer Products, Inc. 1980. Archived from the original (PDF) on 2019-07-14. Retrieved 2019-07-14. (59 pages)
cite-note-drdos6userguide-2929. DR DOS 6.0 User Guide Optimisation and Configuration Tips
cite-note-3030. PC-MOS User Guide
cite-note-3131. citerefjansen2018Jansen, Roeland (8 February 2018). "pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources" – via GitHub.

Further reading

• citerefwolverton1990Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
• citerefkathy-ivensbrian-proffit1993Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
• citereffrisch2001Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. O'Reilly. ISBN 978-0-596-00148-3.

External links

• ren | Microsoft Docs